package com.ff.neuropp.domain;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ff.neuropp.Dto.PageDto;
import com.ff.neuropp.util.DateSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

@Data
@Entity
@ApiModel
@Table(name = "t_career", uniqueConstraints = {@UniqueConstraint(columnNames="id")})
/**
 * 职业生涯表
 * @author sun_weiwu
 *
 */
public class Career extends PageDto {
	 private static final long serialVersionUID = 1L;

	 
	   @Id
	    @GeneratedValue(strategy = GenerationType.IDENTITY)
	    private int id;
	    
	    @OneToOne
		@JoinColumn(name = "career_type_id")
		@ApiModelProperty(value = "职业生涯类型Id")
		private CareerType careerType;

	    @Column(name = "career_name", columnDefinition = "varchar(100) COMMENT '职业生涯名称'")
	    @ApiModelProperty(value = "职业生涯名称")
	    private String careerName; 
	    
	    @Column(name = "career_title", columnDefinition = "varchar(100) COMMENT '职业生涯标题'")
	    @ApiModelProperty(value = "职业生涯标题 ")
	    private String careerTitle ; 
	    
	    @Column(name = "career_desc", columnDefinition = "varchar(2000) COMMENT '职业生涯描述'")
	    @ApiModelProperty(value = "职业生涯描述 ")
	    private String careerDesc ; 
	    
	    @Column(name = "career_job_desc", columnDefinition = "varchar(2000) COMMENT '职业job描述'")
	    @ApiModelProperty(value = "职业job描述 ")
	    private String careerJobDesc ; 
	    
	    @Column(name = "career_img_url", columnDefinition = "varchar(100) COMMENT '职业生涯图片'")
	    @ApiModelProperty(value = "职业生涯图片 ")
	    private String careerImgUrl ; 
	    
	    //操作时间
	    @Column(updatable = false)
	    @org.hibernate.annotations.CreationTimestamp
	    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	    @JsonSerialize(using = DateSerializer.class)
		private Date createDate;
	    
	    @Column(name = "update_time", columnDefinition = "datetime COMMENT '更新时间'")
	    private Date updateTime;
	    
}
